<?php
require_once '../../library/config.php';
require_once '../library/functions.php';

	if (isset($_GET['tc_id']) && $_GET['tc_id'] > 0) {
	$tc_id = (int)$_GET['tc_id'];
	} 
	$sql = "SELECT id, concat(cast(so AS char(3)),'----',cast(date_format(ngayra ,'%d-%m-%Y')as char(10))) AS ngayra
			FROM chitiet_tapchi cttc
			WHERE cttc.tc_id = $tc_id AND hieu_luc =1
			ORDER BY ngayra asc";
	
	$result = dbQuery($sql) ;

	$list1 = '<option value="-1" selected="true">--Chọn số ra--</option>';
	
	while($row = dbFetchArray($result)) {
		list($id, $name) = $row;
		$list1 .= "<option value=\"$id\"";
		$list1 .= ">$name</option>\r\n";
	}	
	echo $list1;
?>